<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="../../include/tag.jsp" %>
<tr>
    <td>
        <c:set var="isPartner" value="false"/>
        <c:if test="${empty cPrivilege.parentId || cPrivilege.parentId == ''}">
            <c:set var="isPartner" value="true"/>
        </c:if>

        <c:if test="${isPartner}">
            <c:set var="thatCount" value="0"/>
        </c:if>
        <c:if test="${!isPartner}">
            <c:set var="thatCount" value="${fn:length(fn:split(cPrivilege.parentIds, ','))}"></c:set>
        </c:if>
        <div style="text-indent: ${(thatCount) * 30}px">${cPrivilege.name}</div>
    </td>
    <td>${cPrivilege.permission}</td>
    <td>
        <c:if test="${cPrivilege.type == 0}">菜单权限</c:if>
        <c:if test="${cPrivilege.type == 1}">其他权限</c:if>
    </td>
    <td><fmt:formatDate value="${cPrivilege.createDate}" pattern="yyyy-MM-dd HH:mm"/></td>
    <td class="tb-opts">
        <div class="comm-opts">
            <a href="${ctx}/system/privilege/children/view.do?parentId=${cPrivilege.id}" target="_self">
                新增下级权限
            </a>
            <a href="${ctx}/system/privilege/view.do?id=${cPrivilege.id}" target="_self">
                编辑
            </a>
        </div>
    </td>
    <c:if test="${fn:length(cPrivilege.childrens) > 0}">
        <c:forEach var="ccPrivilege" items="${cPrivilege.childrens}">
            <c:set var="cPrivilege" value="${ccPrivilege}" scope="request"/>
            <jsp:include page="treeInclude.jsp"></jsp:include>
        </c:forEach>
    </c:if>
</tr>